<div class="main-content">
    <div class="section__content section__content--p20">
        <div class="container-fluid">
            <div class="row m-b-30">
                <div class="col-lg-12">
                    <div class="overview-wrap">
                        <h2 class="title-1">语言列表</h2>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="table-responsive table--no-card m-b-30">
                        <table class="table table-borderless table-striped table-earning">
                            <thead>
                            <tr>
                                <th>语言名称</th>
                                <th>标记</th>
                                <th>开启</th>
                                <th>默认</th>
                                <th  class="td-tools">工具</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php
                            if (sizeof($langs) > 0) {
                                foreach ($langs as $l) {
                                    ?>
                                    <tr>
                                        <td><?php echo $l['name']; ?></td>
                                        <td><img src="<?php echo $l['flag']; ?>"/></td>
                                        <td><?php echo $l['useok'] == 1 ? "<i class=\"fa fa-check-square text-success\"></i>" : "<i class=\"fa fa-minus-square text-danger\" ></i>"; ?></td>
                                        <td><?php echo $l['isdefault'] == 1 ? "<i class=\"fa fa-check-square text-success\"></i>" : "<i class=\"fa fa-minus-square text-danger\" ></i>"; ?></td>
                                        <td class="td-tools">
                                            <button  class="btn btn-primary btn-sm" onclick="showedit(<?php echo $l['id']; ?>)">设置</button>
                                            <button class="btn btn-primary btn-sm"  onclick="showeditLang('<?php echo $l['lang']; ?>')">编辑</button>
                                        </td>
                                    </tr>
                                    <?php
                                }
                            }
                            ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    function showedit(id) {
        window.location.href = "index.php?r=admin/language/showedit&id=" + id;
    }
    function showeditLang(lang) {
        window.location.href = "index.php?r=admin/language/showeditlang&lang=" + lang;
    }
</script>